{extend name="default/template/base_index" /}

{block name="area_header"}
    <link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
    <script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}


            <div class="filter-controls">
                <!-- 日期查询 -->
                <form action="{:url('Wxuser/distribution')}" method="post" class="form-inline">
                    <div class="form-group">
                        <div class="input-group">

                            <div class="input-group-addon">
                                用户昵称
                                <i class="fa fa-user"></i>
                            </div>
                            <input type="text" name="nickname" class="form-control" value="{$nickname}" />
                        </div>
                    </div>
                    <div class="form-group hide">
                        <div class="input-group">
                            <div class="input-group-addon">
                                关注时间
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input type="text" name="startdatetime" id="startdatetime" class="form-control input-short" value="{:date('Y-m-d',$startdatetime)}" />
                            <div class="input-group-addon">
                                <i class="fa fa-long-arrow-right"></i>
                            </div>
                            <input type="text" name="enddatetime" id="enddatetime" class="form-control input-short" value="{:date('Y-m-d',$enddatetime)}" />
                        </div>
                    </div>
                    <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
                </form>
            </div>


            <table class="table table-striped table table-hover  table-condensed">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />昵称
                    </th>
                    <th>
                        头像
                    </th>
                    <th>
                        用户组
                    </th>
                    <th>
                        关注时间
                    </th>
                    <th>
                        {:L('OPERATOR')}
                    </th>
                </tr>
                </thead>
                <tbody>
                {empty name="list"}
                    <tr>
                        <td colspan="5" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    {else/}
                    {volist name="list" id="vo"}
                        <tr>
                            <td>
                                <input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /><a href="{:url(CONTROLLER_NAME .'/view',array('id'=>$vo['id']))}" >{$vo.nickname}</a></td>
                            <td><img src="{$vo.avatar}" class="avatar" style="max-width:60px;"/> </td>
                            <td>
                                {$vo._group_name}
                            </td>
                            <td>
                                {$vo.subscribe_time|date='Y-m-d h:i:s',###}
                            </td>
                            <td>
                                <a href="{:url('Wxuser/sendText',array('id'=>$vo['id']))}" class="btn btn-default btn-sm"><i class="fa fa-send"></i>给他发送消息</a>

                                <a href="{:url('Wxuser/viewFamily',array('id'=>$vo['id']))}" class="btn btn-default btn-sm"><i class="fa fa-eye"></i>查看其家族</a>
                            </td>
                        </tr>

                    {/volist}
                {/empty}
                </tbody>
            </table>
            <div>{$show}</div>

		</div>
		<!-- END admin-main-content -->
	</div>
	<!-- END admin-main-->
{/block}

{block name="area_footer"}

    <script type="text/javascript">
        $(function(){

                $('#startdatetime').datetimepicker({
                    lang: 'ch',
                    format:'Y-m-d',
                    timepicker:false,
                });
                $('#enddatetime').datetimepicker({
                    lang: 'ch',
                    format:'Y-m-d',
                    timepicker:false,
                });
        })

    </script>

{/block}